#include <stdio.h>
#include <stdlib.h>

//双链表
typedef struct DNode
{
    int data;
    struct DNode *prior, *next;
} DNode, *DLinklist;

//初始化双链表
bool InitDLinkList(DLinklist &L)
{
    L = (DNode *)malloc(sizeof(DNode));
    if (L == NULL) //内存分配失败
    {
        return false;
    }
    L->prior = NULL;
    L->next = NULL;
    return true;
}

//判空
bool Empty(DLinklist L)
{
    return L->next == NULL;
}

// p结点后插入s结点
bool InsertNextDNode(DNode *p, DNode *s)
{
    s->next = p->next;
    if (p->next != NULL)
    {
        p->next->prior = s;
    }
    p->next = s;
    s->prior = p;
    return true;
}

//删除p结点
bool DeleteNextDNode(DNode *p)
{
    p->prior->next = p->next;
    if (p->next != NULL)
        p->next->prior = p->prior;
    free(p);
    return true;
}

int main()
{
    printf("\n\n========================================================================\n\n");

    printf("\n\n========================================================================\n\n");
    return 0;
}